package com.easy.cart.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.easy.bean.Carts;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface ICartMapper extends BaseMapper<Carts> {

    int addCartCount(@Param("cart") Carts cart);

    List<Carts> getCartList(@Param("userid") Integer userid);

    @Delete("delete from carts where userid=#{userid} and productid=#{productid}")
    int deleteCart(@Param("userid") int userid,@Param("productid") int productid);
}
